Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: go-ethereum is not updated #1247

Merged
merged 13 commits into from
Dec 4, 2023
Merged

Conversation

mmsqe
Copy link
Collaborator

@mmsqe mmsqe commented Nov 16, 2023

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

Summary by CodeRabbit

  • New Features

    • Implemented a new search bar for enhanced user navigation.
    • Introduced a fresh visual style for the search interface.
  • Bug Fixes

    • Adjusted gas requirements in relayer precompile to accurately reflect consumption.
    • Updated Ethereum-related configurations to improve transaction processing.
  • Documentation

    • Updated CHANGELOG with recent modifications and version updates.
  • Refactor

    • Streamlined parameter key table usage for the EVM module.
    • Optimized fee verification logic to accommodate new Ethereum configurations.
  • Style

    • Enhanced UI elements for better user experience.
  • Chores

    • Updated dependencies to the latest versions for improved performance and security.
  • Tests

    • Added new tests to ensure the reliability of the search functionality.

Please note that internal code changes, filenames, and specific functions have been omitted for confidentiality.

Copy link
Contributor

coderabbitai bot commented Nov 16, 2023

Walkthrough

The changes revolve around updates to Ethereum-related modules, particularly involving gas calculations, EVM parameter key tables, and chain configuration. The updates include the removal of statefulness checks in precompile contracts, adjustments to gas requirements to align with actual consumption, and the introduction of new protocol buffer definitions for various EVM components. Additionally, there's a shift to accommodate the Shanghai upgrade in fee verification and intrinsic gas calculations.

Changes

File Path Change Summary
CHANGELOG.md Updated ethermint to develop version and go-ethereum to v1.11.2; adjusted gas in relayer precompile.
app/app.go Updated EVM module's key table usage; removed WithKeyTable method call; added ethparams package import; modified custom contract functions to accept ethparams.Rules.
app/upgrades.go Imported v0evmtypes package; updated keyTable assignment to use v0evmtypes.ParamKeyTable().
x/cronos/keeper/... Removed IsStateful method from precompile contracts; added shanghai variable for fee verification; updated RelayerContract with chain config booleans and SetChainConfig method.
third_party/proto/ethermint/evm/v1/... Introduced new protocol buffer files and messages for EVM module; updated imports and fields in existing messages.
integration_tests/network.py Added --miner.etherbase flag to Geth node start command.
nix/go-ethereum.nix Updated go-ethereum version to 1.11.2 and checksums; removed "cmd/puppeth" entry.
scripts/start-geth Included --password flag in account import command.
x/cronos/keeper/precompiles/relayer.go Added chain configuration booleans to RelayerContract; modified RequiredGas method; removed IsStateful method.

"In the code where bytes dance and play,
A rabbit hopped through, refining the fray.
With a tweak and a fix, the ether does flow,
A blockchain's heart, now beating just so. 🐇💻✨"


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Copy link

codecov bot commented Nov 16, 2023

Codecov Report

Merging #1247 (73a9a96) into main (e654fbc) will increase coverage by 11.32%.
The diff coverage is 33.33%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1247       +/-   ##
===========================================
+ Coverage   36.81%   48.13%   +11.32%     
===========================================
  Files         115       74       -41     
  Lines       10287     6197     -4090     
===========================================
- Hits         3787     2983      -804     
+ Misses       6126     2896     -3230     
+ Partials      374      318       -56     
Files Coverage Δ
app/upgrades.go 46.66% <100.00%> (ø)
x/cronos/keeper/grpc_query.go 0.00% <0.00%> (ø)

... and 52 files with indirect coverage changes

@mmsqe mmsqe force-pushed the bump_v1.11.0 branch 2 times, most recently from 4bf75fc to dadd67b Compare November 21, 2023 01:30
@mmsqe mmsqe marked this pull request as ready for review November 22, 2023 10:20
@mmsqe mmsqe requested a review from a team as a code owner November 22, 2023 10:20
@mmsqe mmsqe requested review from yihuang and leejw51crypto and removed request for a team November 22, 2023 10:20
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 6834ef9 and 9949532.
Files ignored due to filter (3)
  • go.mod
  • go.sum
  • gomod2nix.toml
Files selected for processing (7)
  • CHANGELOG.md (1 hunks)
  • app/app.go (2 hunks)
  • app/upgrades.go (2 hunks)
  • x/cronos/keeper/grpc_query.go (2 hunks)
  • x/cronos/keeper/precompiles/bank.go (1 hunks)
  • x/cronos/keeper/precompiles/ica.go (1 hunks)
  • x/cronos/keeper/precompiles/relayer.go (2 hunks)
Additional comments: 9
CHANGELOG.md (1)
  • 13-17: The changelog correctly documents the significant updates made to the relayer precompile and the dependencies, including the go-ethereum version bump. This aligns with the pull request summary provided.
x/cronos/keeper/precompiles/bank.go (1)
  • 85-90: The IsStateful function has been removed from the BankContract struct. Ensure that this change does not affect any other part of the system that might rely on the statefulness information of the contract. If the function was removed because all contracts are now assumed to be stateful or stateless, this should be clearly documented to avoid confusion.
x/cronos/keeper/precompiles/relayer.go (2)
  • 69-75: The core.IntrinsicGas function call has been updated to include additional boolean arguments. Verify that these arguments correctly represent the desired transaction type and that they align with the updated go-ethereum version's requirements for intrinsic gas calculation.

  • 90-90: The RequiredGas method now correctly calculates the required gas by subtracting the intrinsic gas from the total. This change seems to be in line with the updated go-ethereum library's gas calculation requirements.

app/app.go (1)
  • 1154-1160: The change from evmtypes.ParamKeyTable() to v0evmtypes.ParamKeyTable() is significant as it indicates a versioning or restructuring of the EVM module's parameter key table. Ensure that this change is consistent with the intended versioning strategy and that it does not introduce any compatibility issues with existing parameters or state.
app/upgrades.go (2)
  • 30-36: The import for v0evmtypes has been added, which suggests a new version or migration path for the EVM module types. Ensure that this new import is used consistently throughout the codebase and that any deprecated types are no longer in use.

  • 64-70: The ParamKeyTable for the evmtypes.ModuleName has been updated to use v0evmtypes.ParamKeyTable(). This change should be verified to ensure that it aligns with the intended migration strategy and that the new key table is compatible with existing parameters and their usage within the module.

x/cronos/keeper/grpc_query.go (2)
  • 67-73: The introduction of the shanghai variable is consistent with the summary provided. It's important to ensure that the IsShanghai function is correctly implemented and tested, as it now plays a critical role in fee verification.

  • 83-89: The VerifyFee function signature has been updated to include the shanghai parameter. This change should be cross-checked with the evmkeeper module to ensure that the function definition is updated accordingly and that the new parameter is being used correctly within the function.

x/cronos/keeper/precompiles/ica.go Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 9949532 and 9fb3522.
Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • app/app.go (1 hunks)
Additional comments: 2
CHANGELOG.md (1)
app/app.go (1)
  • 1153-1159: The removal of WithKeyTable method call for the evmtypes.ModuleName subspace in the initParamsKeeper function is consistent with the change summary. However, ensure that the removal does not affect the parameter key table configuration for the EVM module and that the application still functions as expected without it.

@@ -67,6 +67,7 @@
blockHeight := big.NewInt(req.BlockNumber)
homestead := ethCfg.IsHomestead(blockHeight)
istanbul := ethCfg.IsIstanbul(blockHeight)
shanghai := ethCfg.IsShanghai(uint64(req.BlockTime.Unix()))

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion Error

Potential integer overflow by integer type conversion
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 9fb3522 and 7375384.
Files ignored due to filter (4)
  • client/docs/swagger-ui/swagger.yaml
  • go.mod
  • go.sum
  • gomod2nix.toml
Files selected for processing (17)
  • third_party/proto/ethermint/evm/v1/access_tuple.proto (1 hunks)
  • third_party/proto/ethermint/evm/v1/chain_config.proto (1 hunks)
  • third_party/proto/ethermint/evm/v1/chain_config_v0.proto (1 hunks)
  • third_party/proto/ethermint/evm/v1/genesis.proto (1 hunks)
  • third_party/proto/ethermint/evm/v1/log.proto (1 hunks)
  • third_party/proto/ethermint/evm/v1/params.proto (1 hunks)
  • third_party/proto/ethermint/evm/v1/params_v0.proto (1 hunks)
  • third_party/proto/ethermint/evm/v1/params_v4.proto (1 hunks)
  • third_party/proto/ethermint/evm/v1/query.proto (2 hunks)
  • third_party/proto/ethermint/evm/v1/state.proto (1 hunks)
  • third_party/proto/ethermint/evm/v1/trace_config.proto (1 hunks)
  • third_party/proto/ethermint/evm/v1/trace_config_v0.proto (1 hunks)
  • third_party/proto/ethermint/evm/v1/transaction_logs.proto (1 hunks)
  • third_party/proto/ethermint/evm/v1/tx.proto (2 hunks)
  • third_party/proto/ethermint/evm/v1/tx_result.proto (1 hunks)
  • x/cronos/keeper/grpc_query.go (2 hunks)
  • x/cronos/keeper/precompiles/relayer.go (3 hunks)
Files skipped from review due to trivial changes (1)
  • third_party/proto/ethermint/evm/v1/chain_config.proto
Additional comments: 21
third_party/proto/ethermint/evm/v1/genesis.proto (1)
  • 1-8: The changes to the import statements and go_package option are consistent with the summary provided. Ensure that the new imports are correctly referenced in the rest of the codebase and that the updated go_package path is valid and accessible.
third_party/proto/ethermint/evm/v1/log.proto (1)
  • 1-37:
    The protobuf definition for the Log message is well-structured and includes all necessary fields with appropriate data types and JSON tags for Ethereum log events.
third_party/proto/ethermint/evm/v1/transaction_logs.proto (1)
  • 1-16:
    The protobuf definition for TransactionLogs is well-defined and includes all necessary fields and imports as per the summary.
third_party/proto/ethermint/evm/v1/state.proto (1)
  • 1-12:
    The protobuf definition for the State message is correctly implemented.
third_party/proto/ethermint/evm/v1/access_tuple.proto (1)
  • 1-16:
    The new AccessTuple message definition appears to be correctly implemented according to the proto3 specification and is consistent with the project's use of gogoproto extensions.
third_party/proto/ethermint/evm/v1/params_v0.proto (1)
  • 1-25:
    The protobuf message V0Params is correctly defined and follows the proto3 syntax and conventions. The fields are well-documented, and the use of gogoproto options for custom names and tags is appropriate.
third_party/proto/ethermint/evm/v1/trace_config.proto (1)
  • 1-39:
    The protobuf definition for TraceConfig correctly reflects the changes described in the summary, with appropriate deprecation and renaming of fields. The use of reserved fields and tags ensures backward compatibility and prevents conflicts with future changes.
third_party/proto/ethermint/evm/v1/params.proto (1)
  • 1-25:

The protobuf definition for Params is correctly defined and includes all the necessary fields and options as per the summary provided. The use of gogoproto options for custom names and YAML tags is appropriate, and the import statements are correctly specified.

third_party/proto/ethermint/evm/v1/query.proto (2)
  • 2-11:
    The import changes align with the pull request summary, ensuring the protobuf file reflects the updated dependencies and new functionality.

  • 227-231:
    The addition of the overrides field in EthCallRequest is consistent with the change summary, allowing for state overrides during EVM calls.

third_party/proto/ethermint/evm/v1/params_v4.proto (1)
  • 1-31:

The protobuf definitions for V4Params and ExtraEIPs are well-defined and follow the standard conventions for defining messages and fields in proto3. The use of gogoproto options for custom names and YAML tags is appropriate and enhances the compatibility with Go code and YAML serialization.

x/cronos/keeper/grpc_query.go (2)
  • 67-72:
    The use of uint64(req.BlockTime.Unix()) could lead to an integer overflow. Verify that req.BlockTime.Unix() will not exceed the maximum value for uint64 and consider adding overflow checks if necessary.

  • 83-89:
    The changes to the VerifyFee function call correctly include the new shanghai parameter. Ensure that the VerifyFee function is updated accordingly to handle this new parameter.

third_party/proto/ethermint/evm/v1/trace_config_v0.proto (1)
  • 1-39: - Ensure that all deprecated fields are no longer used in the codebase and that any necessary migrations to the new fields have been completed.
  • Verify that the JSON tags provided in the protobuf definitions match the expected JSON structure in the rest of the application.
  • Confirm that the V0ChainConfig import is used correctly and that the corresponding message is compatible with the overrides field in V0TraceConfig.
  • Check that the go_package option is correctly set to match the project's directory structure and naming conventions.
  • Review the use of custom JavaScript tracers and ensure that the tracer field is properly sanitized and handled to prevent any potential security issues.
  • Validate that the timeout, reexec, limit, and tracer_json_config fields are being correctly parsed and used wherever V0TraceConfig is instantiated.
third_party/proto/ethermint/evm/v1/tx.proto (2)
  • 3-13: The imports for "ethermint/evm/v1/access_tuple.proto", "ethermint/evm/v1/log.proto", and "ethermint/evm/v1/params.proto" have been correctly added to support the new protobuf definitions for EVM-related messages. Ensure that these new files are present in the project and that their definitions are being used correctly in the codebase.

  • 34-41: The field "from" in the MsgEthereumTx message has been correctly changed from a string to bytes, and a deprecated string field "deprecated_from" has been added. Ensure that all parts of the codebase that interact with the "from" field are updated to handle bytes instead of a string, and that the presence of "deprecated_from" is accounted for in any legacy handling or migration logic.

third_party/proto/ethermint/evm/v1/tx_result.proto (1)
  • 1-28: - Ensure that the TxResult message fields align with the Ethereum standards and the intended use within the Crypto.org Chain project.
  • Verify that the TransactionLogs message is correctly defined and imported, as it is a critical part of the TxResult.
  • Confirm that the contract_address field should be a string and not an Ethereum address type, which is typically represented as bytes.
  • Check that the bloom field is being correctly used and interpreted in the codebase, as bloom filters have specific encoding and decoding requirements.
  • Ensure that the ret field is being handled correctly, especially in cases where the execution result is large.
  • Verify that the reverted field is being set and checked correctly throughout the codebase, as it is crucial for error handling.
  • Confirm that the gas_used field is being calculated and used correctly, as gas usage is a fundamental aspect of EVM execution and transaction cost.
x/cronos/keeper/precompiles/relayer.go (4)
  • 45-54: The RelayerContract struct has been updated with new boolean fields to represent the status of Ethereum hard forks. Ensure that these fields are properly set and used throughout the codebase to maintain the correct behavior based on the active hard forks.

  • 69-73: The SetChainConfig method has been added to set the Ethereum hard fork status flags in the RelayerContract. Verify that this method is called with the correct values during the initialization or configuration of the contract to reflect the actual chain configuration.

  • 77-84: The RequiredGas method now uses the new hard fork status flags to calculate the intrinsic gas. Ensure that the error handling for core.IntrinsicGas is adequate and that it doesn't silently fail, potentially causing issues with gas calculation.

  • 99-100: The RequiredGas method correctly calculates the total gas required minus the intrinsic gas. Ensure that the gas calculation aligns with the updated Ethereum gas pricing rules post-hard forks.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 7375384 and 796cf0d.
Files ignored due to filter (4)
  • go.mod
  • go.sum
  • gomod2nix.toml
  • scripts/geth-genesis.json
Files selected for processing (4)
  • integration_tests/network.py (1 hunks)
  • nix/go-ethereum.nix (2 hunks)
  • scripts/start-geth (2 hunks)
  • x/cronos/keeper/precompiles/relayer.go (3 hunks)
Files skipped from review due to trivial changes (2)
  • integration_tests/network.py
  • scripts/start-geth
Additional comments: 4
nix/go-ethereum.nix (2)
  • 13-24:
    The version update and checksum changes are correct and align with the standard Nix package update process.

  • 42-47:
    The summary mentions the removal of "cmd/puppeth" from the list of components, but it is not reflected in the subPackages list. Please verify if this is an oversight.

x/cronos/keeper/precompiles/relayer.go (2)
  • 45-54: The RelayerContract struct has been extended with new boolean fields to represent chain configurations. Ensure that these fields are properly documented and that their usage is consistent throughout the codebase.

  • 69-78: The WithChainConfig method is introduced to set the chain configuration flags on the RelayerContract. Ensure that this method is used correctly wherever a RelayerContract instance is created or modified to reflect the intended chain configuration.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 796cf0d and bfb3920.
Files ignored due to filter (3)
  • go.mod
  • go.sum
  • gomod2nix.toml
Files selected for processing (2)
  • app/app.go (3 hunks)
  • x/cronos/keeper/precompiles/relayer.go (4 hunks)
Additional comments: 2
app/app.go (1)
  • 1158-1164: The WithKeyTable method call has been removed from the paramsKeeper.Subspace for the evmtypes.ModuleName and feemarkettypes.ModuleName. However, the WithKeyTable method is still being used for other modules. Ensure that this change is intentional and that the key table is not required for the evmtypes.ModuleName and feemarkettypes.ModuleName subspaces.
x/cronos/keeper/precompiles/relayer.go (1)
  • 46-66: The addition of the isHomestead, isIstanbul, and isShanghai fields to the RelayerContract struct and their initialization in the NewRelayerContract function are consistent with the summary and appear to be correctly implemented.

x/cronos/keeper/precompiles/relayer.go Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between bfb3920 and b1e2851.
Files ignored due to filter (3)
  • go.mod
  • go.sum
  • gomod2nix.toml
Files selected for processing (3)
  • CHANGELOG.md (1 hunks)
  • app/app.go (3 hunks)
  • x/cronos/keeper/precompiles/ica.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
Additional comments: 2
app/app.go (2)
  • 152-162: The summary states that the package github.com/ethereum/go-ethereum/core/vm was removed, but it is still present in the imports. Please verify if this package should indeed be removed or if the summary is incorrect.

  • 1160-1166: The initParamsKeeper function has been correctly updated to no longer use the evmtypes.ParamKeyTable() for the evmtypes.ModuleName subspace, aligning with the summary of changes.

app/app.go Show resolved Hide resolved
@mmsqe mmsqe requested a review from yihuang December 4, 2023 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants